#include <rtthread.h>

#include <stdio.h>

#include <bmi088.h>

static int bmi(int argc, char **argv)
{
    NXMFC::bmi088 b;
    int cnt = 100;

    if (!b.open("acc", "gry"))
    {
        printf("open bmi fail\r\n");
        return -1;
    }

    while (cnt -- > 0)
    {
        short x, y, z;

        b.readAccel(x, y, z);
        printf("A[%d, %d, %d]\r\n", x, y, z);
        rt_thread_mdelay(500);
        b.readGyro(x, y, z);
        printf("G[%d, %d, %d]\r\n", x, y, z);
        rt_thread_mdelay(500);        
    }

    return 0;
}
MSH_CMD_EXPORT(bmi, test bmi088);
